function imPrefs(){
  this.prefBranch = CC['@mozilla.org/preferences-service;1'].getService().QueryInterface(CI.nsIPrefBranch);
  this.PREF_STATUSBAR_ENABLED			= "jazzila.statusbar.enabled"; 
  this.PREF_STATUSWIN_ENABLED			= "jazzila.sidebar.enabled"; // oops, sidebar?
  this.PREF_AUTOLOGIN				= "jazzila.autologin.enabled";
  this.PREF_AUTORECONNECT_ENABLED		= "jazzila.autoreconnect.enabled";
  this.PREF_NOTIFICATIONS_ENABLED		= "jazzila.ui.notification.enabled";
  this.PREF_SERVER_HOST				= "jazzila.server.host";
  this.PREF_SERVER_PORT				= "jazzila.server.port";
  this.PREF_SERVER_TLS				= "jazzila.server.tls";
  this.PREF_SERVER_SSL				= "jazzila.server.ssl";
  this.PREF_AUTOSUBSCRIBE			= "jazzila.prefs.autosubscribe";
  this.PREF_SERVER_RESOURCE			= "jazzila.server.resource";
  this.PREF_REMEMBER_PASSWORD  			= "jazzila.remember.password";
  this.HTTP_BINDING    				= "jazzila.http.binding";
  this.HTTP_UPDATE_INTERVAL			= "jazzila.http.polling.interval";
  this.HTTP_GW     				= "jazzila.http.gateway";
  this.HTTP_REMEMBER_PASSWORD  			= "jazzila.http.remember.password";
  this.PREF_DEBUG_CONSOLE_ENABLED		= "jazzila.debugconsole.enabled";
  this.PREF_SOUNDNOTIFICATIONS_ENABLED		= "jazzila.ui.soundnotification.enabled";
}

imPrefs.prototype.getPrefBranch = function(){
  return this.prefBranch;
}

imPrefs.prototype.setBoolPref = function(aName, aValue){
  this.getPrefBranch().setBoolPref(aName, aValue);
}


imPrefs.prototype.getBoolPref = function(aName){
  var rv = null;

  try{
    rv = this.getPrefBranch().getBoolPref(aName);
  } catch (e){
  
  }
  
  return rv;
}

imPrefs.prototype.setIntPref = function(aName, aValue){
  this.getPrefBranch().setIntPref(aName, aValue);
}


imPrefs.prototype.getIntPref = function(aName){
  var rv = null;

  try{
    rv = this.getPrefBranch().getIntPref(aName);
  } catch (e){
  
  }
  
  return rv;
}

imPrefs.prototype.setCharPref = function(aName, aValue){
	this.getPrefBranch().setCharPref(aName, aValue);
}

imPrefs.prototype.getCharPref = function(aName){
  var rv = null;

  try{
    rv = this.getPrefBranch().getCharPref(aName);
  } catch (e){
  
  }
  
  return rv;
}

imPrefs.prototype.addObserver = function(aDomain, aFunction){
  var myPrefs = this.getPrefBranch();
  var prefBranchInternal = myPrefs.QueryInterface(CI.nsIPrefBranchInternal);
                                                                                             
  if (prefBranchInternal)
    prefBranchInternal.addObserver(aDomain, aFunction, false);
}

imPrefs.prototype.removeObserver = function(aDomain, aFunction){
  var myPrefs = this.getPrefBranch();
  var prefBranchInternal = myPrefs.QueryInterface(Components.interfaces.nsIPrefBranchInternal);
                                                                                             
  if (prefBranchInternal)
    prefBranchInternal.removeObserver(aDomain, aFunction);
}
